<?php
 define('IN_DAEM', true); include '../includes/init.php'; $type = $_POST['type']; if ($type == 'select') { $studentInfoAry = get_student_info('y'); $studentInfoNoLimitAry = get_student_info(); $cid = $_POST['cid']; $courseStudentStr = ''; $courseStudentAry = array(); $sql = "select sid from ".DB_DAEMDB.".".TB_SUFFIX."hr_course_enroll WHERE cid = '".$cid."' and status = '1'"; $query = $db->query($sql); while ($row = $db->fetch_array($query)) { if (isset($studentInfoAry[$row['sid']])) { $courseStudentStr .= $studentInfoAry[$row['sid']].','; $courseStudentAry[$row['sid']] = $studentInfoAry[$row['sid']]; } } $courseStudentStr = trim($courseStudentStr,','); $section_html = get_return_section('select1',$courseStudentAry,'',$ary_first=array(''),'select1','','width:150px;height:200px;float:left;padding:4px;',' multiple="multiple"'); echo json_encode(array('course_student_str'=>$courseStudentStr,'section_html'=>$section_html));die; }